<?php

function bbcode($texte)
{
	$texte = str_replace("(tableau)", "<table style=\"width: 100%;\">", $texte);
	$texte = preg_replace("/\(tableau style=(.*?)\)/i", "<table style=\"\\1\">", $texte);
	$texte = str_replace("(/tableau)", "</table>", $texte);
	$texte = str_replace("(ligne)", "<tr>", $texte);
	$texte = str_replace("(/ligne)", "</tr>", $texte);
	$texte = str_replace("(colonne)", "<td valign=\"top\">", $texte);
	$texte = str_replace("(/colonne)", "</td>", $texte);
	$texte = preg_replace("/\(colonne fusion_h=(.*?) fusion_v=(.*?) style=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\1\" rowspan=\"\\2\" style=\"\\3\">", $texte);
	$texte = preg_replace("/\(colonne fusion_v=(.*?) fusion_h=(.*?) style=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\2\" rowspan=\"\\1\" style=\"\\3\">", $texte);
	$texte = preg_replace("/\(colonne style=(.*?) fusion_h=(.*?) fusion_v=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\3\" rowspan=\"\\1\" style=\"\\2\">", $texte);
	$texte = preg_replace("/\(colonne style=(.*?) fusion_v=(.*?) fusion_h=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\3\" rowspan=\"\\2\" style=\"\\1\">", $texte);
	$texte = preg_replace("/\(colonne fusion_h=(.*?) style=(.*?)\) fusion_v=(.*?)/i", "<td valign=\"top\" colspan=\"\\1\" rowspan=\"\\3\" style=\"\\2\">", $texte);
	$texte = preg_replace("/\(colonne fusion_v=(.*?) style=(.*?)\) fusion_h=(.*?)/i", "<td valign=\"top\" colspan=\"\\2\" rowspan=\"\\3\" style=\"\\1\">", $texte);
	$texte = preg_replace("/\(colonne fusion_v=(.*?)\)/i", "<td valign=\"top\" rowspan=\"\\1\">", $texte);
	$texte = preg_replace("/\(colonne fusion_h=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\1\">", $texte);
	$texte = preg_replace("/\(colonne style=(.*?)\)/i", "<td valign=\"top\" style=\"\\1\">", $texte);
	$texte = preg_replace("/\(colonne fusion_v=(.*?) style=(.*?)\)/i", "<td valign=\"top\" rowspan=\"\\1\" style=\"\\2\">", $texte);
	$texte = preg_replace("/\(colonne style=(.*?) fusion_v=(.*?)\)/i", "<td valign=\"top\" rowspan=\"\\2\" style=\"\\1\">", $texte);
	$texte = preg_replace("/\(colonne fusion_h=(.*?) style=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\1\" style=\"\\2\">", $texte);
	$texte = preg_replace("/\(colonne style=(.*?) fusion_h=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\2\" style=\"\\1\">", $texte);
	$texte = preg_replace("/\(colonne fusion_h=(.*?) fusion_v=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\1\" rowspan=\"\\2\">", $texte);
	$texte = preg_replace("/\(colonne fusion_v=(.*?) fusion_h=(.*?)\)/i", "<td valign=\"top\" colspan=\"\\2\" rowspan=\"\\1\">", $texte);
	
	return $texte;
}

function int_bbcode()
{

}

?>